/*
 * Copyright (C) 2021 xuexiangjys(xuexiangjys@163.com)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

package com.xuexiang.xuidemo.fragment.userinfo;

import android.widget.ListView;

import com.xuexiang.xpage.annotation.Page;
import com.xuexiang.xui.widget.actionbar.TitleBar;
import com.xuexiang.xuidemo.R;
import com.xuexiang.xuidemo.adapter.account.AccountAdapter;
import com.xuexiang.xuidemo.base.BaseFragment;
import com.xuexiang.xuidemo.entity.UserAccount;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;

@Page(name = "账号管理")
public class AccountFragment extends BaseFragment {
    @BindView(R.id.account_list)
    ListView listView;

    List<UserAccount> list;
    AccountAdapter listAdapter;
    UserAccount userAccount;

    @Override
    protected int getLayoutId() {
        return R.layout.fragment_account;
    }

    @Override
    protected void initViews() {
        userAccount = new UserAccount("Feue");
        list = new ArrayList<>();
        list.add(userAccount);
        list.add(new UserAccount("zyggg"));
        listAdapter = new AccountAdapter(getContext(), R.layout.item_account, list);
        listView.setAdapter(listAdapter);

    }
}
